import request from "../util/request";

// 添加广告请求
export const addAdvRequest=(myForm)=>{
  return request.post("/addAdv",myForm)
}

// 查询所有的广告
export const advListRequest=(pageNo=1,everyNum=3)=>{
  return  request.get(`/advList/${pageNo}/${everyNum}`)
}
// 发送删除广告请求
export const deleteAdvRequest=(_id)=>{
  return request.delete("/deleteAdv",{
    params:{
      _id
    }
  })
}

// 发送更新广告时  获取当前广告信息
export const getUpdateDataRequest=(_id)=>{
  return request.get("/getUpdateData",{
    params:{
      _id
    }
  })
}

// 发送更新广告数据逻辑
export const updateAdvRequest=(formDate,_id)=>{
  return request.put("/updateAdv",formDate,{
    params:{
      _id
    }
  })
}